import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

import vuexPersist from "vuex-persist";
export default new Vuex.Store({
  state: {
    list: [],
  },
  mutations: {
    setlist(state, list) {
      state.list = list;
    },
    clear(state, result) {
      state.list = state.list.filter((item) => {
        return result.includes(item) == false;
      });
    },
    //把不删的留下来
  },
  actions: {},
  modules: {},
  plugins: [
    new vuexPersist({
      storage: window.localStorage,
    }).plugin,
  ],
});
